// import xlsx from 'node-xlsx';
const xlsx = require('node-xlsx').default;


const workSheetsFromFile = xlsx.parse(`${__dirname}/abc.xlsx`);
const colums = workSheetsFromFile[0].data[0]
const data = workSheetsFromFile[0].data.slice(1)
console.log(colums, data)

let last = ''

for (const cell of data) {
    // console.log(cell[2], cell[6], cell[7]);
    const [day, time] = cell[6].split(' ');
    console.log(day, time)
    const [time1, time2] = time.split('~')
    const start = day.split('-').join('') + 'T' + time1.split(':').join('') + '00'
    const end = day.split('-').join('') + 'T' + time2.split(':').join('') + '00'
    // 20231202T140000
    const ev = `BEGIN:VEVENT
DTSTART=China Standard Time:${start}
DTEND=China Standard Time:${end}
LOCATION:${cell[7]}
SUMMARY:${cell[2]}
END:VEVENT`
    console.log(ev)
}